<%--
  Created by IntelliJ IDEA.
  User: 武露斌
  Date: 2021/10/20
  Time: 15:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../../js/jquery-1.8.2.min.js"></script>
    <script src="../../js/fileupload.js"></script>
    <link rel="stylesheet" href="../../css/css.css">
    <link rel="stylesheet" href="../../css/img.css">
</head>
<body>

<form>
    拍摄地点：<input type="text" name="sname"><br>
    具体地址：<input type="text" name="saddress"><br>
    场景费用：<input type="text" name="smoney"><br><br>
    照片：
    <div class="photoUpLoad" >
    <input type="file"   class="photo" name="photo" accept="image/*"><span class="cross">+</span>
    <img src="" alt="" class="photoEcho">
</div><br>

</form>
<input type="button" value="添加" onclick="add()">

</body>
</html>

<script>

    function add() {
        var formData = new FormData($("form")[0]);

        $.ajax({
            url:"addpsto.do",
            data:formData,
            type:"post",
            dataType:"json",
            success:function (data) {
                if (data>0){
                    alert("添加成功")
                    location="list.do"
                }else{
                    alert("添加失败")
                }
            },processData:false,contentType:false
        })
    }

</script>
